package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 化工厂信息表
 * @TableName chemical_factory
 */
@TableName(value ="chemical_factory")
@Data
public class ChemicalFactory implements Serializable {
    /**
     * 工厂ID
     */
    @TableId(type = IdType.AUTO)
    private Long factoryId;

    /**
     * 工厂名称
     */
    private String factoryName;

    /**
     * 工厂编码
     */
    private String factoryCode;

    /**
     * 经度
     */
    private BigDecimal longitude;

    /**
     * 纬度
     */
    private BigDecimal latitude;

    /**
     * 详细地址
     */
    private String address;

    /**
     * 工厂类型
     */
    private String factoryType;

    /**
     * 主要污染物
     */
    private String mainPollutants;

    /**
     * 风险等级：1-低，2-中，3-高
     */
    private Integer riskLevel;

    /**
     * 状态：1-正常，2-停产
     */
    private Integer status;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ChemicalFactory other = (ChemicalFactory) that;
        return (this.getFactoryId() == null ? other.getFactoryId() == null : this.getFactoryId().equals(other.getFactoryId()))
            && (this.getFactoryName() == null ? other.getFactoryName() == null : this.getFactoryName().equals(other.getFactoryName()))
            && (this.getFactoryCode() == null ? other.getFactoryCode() == null : this.getFactoryCode().equals(other.getFactoryCode()))
            && (this.getLongitude() == null ? other.getLongitude() == null : this.getLongitude().equals(other.getLongitude()))
            && (this.getLatitude() == null ? other.getLatitude() == null : this.getLatitude().equals(other.getLatitude()))
            && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
            && (this.getFactoryType() == null ? other.getFactoryType() == null : this.getFactoryType().equals(other.getFactoryType()))
            && (this.getMainPollutants() == null ? other.getMainPollutants() == null : this.getMainPollutants().equals(other.getMainPollutants()))
            && (this.getRiskLevel() == null ? other.getRiskLevel() == null : this.getRiskLevel().equals(other.getRiskLevel()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getFactoryId() == null) ? 0 : getFactoryId().hashCode());
        result = prime * result + ((getFactoryName() == null) ? 0 : getFactoryName().hashCode());
        result = prime * result + ((getFactoryCode() == null) ? 0 : getFactoryCode().hashCode());
        result = prime * result + ((getLongitude() == null) ? 0 : getLongitude().hashCode());
        result = prime * result + ((getLatitude() == null) ? 0 : getLatitude().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getFactoryType() == null) ? 0 : getFactoryType().hashCode());
        result = prime * result + ((getMainPollutants() == null) ? 0 : getMainPollutants().hashCode());
        result = prime * result + ((getRiskLevel() == null) ? 0 : getRiskLevel().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", factoryId=").append(factoryId);
        sb.append(", factoryName=").append(factoryName);
        sb.append(", factoryCode=").append(factoryCode);
        sb.append(", longitude=").append(longitude);
        sb.append(", latitude=").append(latitude);
        sb.append(", address=").append(address);
        sb.append(", factoryType=").append(factoryType);
        sb.append(", mainPollutants=").append(mainPollutants);
        sb.append(", riskLevel=").append(riskLevel);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}